package edu.hawaii.senin.iclouds.basics;

/**
 * Provides the interval object for the probability calculations. Basic purpose is to check if the
 * value is within the fixed interval or not.
 * 
 * @author Pavel Senin.
 * 
 */
public class Interval {
  /**
   * low bound.
   */
  private Double low;
  /**
   * High bound.
   */
  private Double high;

  /**
   * Instantiates new Interval.
   * 
   * @param low low bound.
   * @param high high bound.
   */
  public Interval(Double low, Double high) {
    this.low = low;
    this.high = high;
  }

  /**
   * Checks if the provided point is within the interval.
   * 
   * @param value value to check.
   * @return true if the provided value within the interval or false instead.
   */
  public boolean within(Double value) {
    return (this.low <= value) && (value < this.high);
  }

  public Double getLowBound() {
    return this.low;
  }

  public Double getHighBound() {
    return this.high;
  }
}
